MenuTreeFor(HtmlHelper,CmsPage,CmsPage,IDictionary<String,Object>) Method
KalikoCMS.Mvc.Extensions Namespace > HtmlHelperExtensions Class > MenuTreeFor Method : MenuTreeFor(HtmlHelper,CmsPage,CmsPage,IDictionary<String,Object>) Method |
The active page in the menu tree.
The root page to render the tree from.
Additional Html attributes to apply to the menu. Use itemClass to apply a class to items in list, linkClass to apply a class to links in list and selectedItemClass to apply a class to the active element.
Creates a menu tree based on a root and a current page.
Syntax
'Declaration
<ExtensionAttribute()> Public Overloads Shared Function MenuTreeFor( _ ByVal helper As HtmlHelper, _ ByVal page As CmsPage, _ ByVal rootPage As CmsPage, _ Optional ByVal htmlAttributes As IDictionary(Of String,Object) _ ) As IHtmlString
[Extension()] public static IHtmlString MenuTreeFor( HtmlHelper helper, CmsPage page, CmsPage rootPage, IDictionary<string,object> htmlAttributes )
Parameters
- helper
- page
- The active page in the menu tree.
- rootPage
- The root page to render the tree from.
- htmlAttributes
- Additional Html attributes to apply to the menu. Use itemClass to apply a class to items in list, linkClass to apply a class to links in list and selectedItemClass to apply a class to the active element.
Return Value
A hierarcic Html list representing the menu tree.
Example
@Html.MenuTreeFor(Model.CurrentPage, PageFactory.GetPage(Model.CurrentPage.RootId))
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2